<!DOCTYPE HTML>
<title>SVGDefsElement interface</title>
<link rel="author" title="Timothy Gu" href="mailto:timothygu99@gmail.com">
<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#InterfaceSVGDefsElement">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<svg id="svg">
  <defs id="defs">
    <circle id="myCircle" cx="0" cy="0" r="5" />
  </defs>
</svg>

<script>
"use strict";

test(() => {
  const svg = document.getElementById("svg");
  const defs = document.getElementById("defs");
  assert_true(defs instanceof SVGDefsElement);
  assert_true(defs instanceof SVGGraphicsElement);
  assert_equals(defs.ownerSVGElement, svg);
  assert_equals(defs.viewportElement, svg);
}, "Basic properties");

test(() => {
  const defs = document.createElementNS("http://www.w3.org/2000/svg", "defs");
  assert_true(defs instanceof SVGDefsElement);
  assert_true(defs instanceof SVGGraphicsElement);
  assert_equals(defs.ownerSVGElement, null);
  assert_equals(defs.viewportElement, null);
}, "Detached");

</script>
